Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup Annotations #116

Merged
merged 6 commits into from
Aug 18, 2020
Merged

Backup Annotations #116

merged 6 commits into from
Aug 18, 2020

Conversation

PrismaPhonic
Copy link
Contributor

This PR adds support to pass annotations down to both backup pods and the backup sub-controller. A use case for this feature is to support IAM access.

…d to backup pods.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
pkg/apis/planetscale/v2/vitessbackupstorage_types.go Outdated Show resolved Hide resolved
InitContainers: pool.InitContainers,
SidecarContainers: pool.SidecarContainers,
ExtraEnv: pool.ExtraEnv,
Annotations: vts.Spec.Annotations,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field vts.Spec.Annotations is for annotations on the VitessShard object. I think what we want is pool.Annotations?

Also, did you check that this field is respected for vtbackup Pods even though it wasn't being filled in before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Also, I'm not sure what you mean by respected. Would you mind re-phrasing that question?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code that builds vtbackup Pods is separate from the code that builds vttablet Pods. Only some of these vttablet spec fields are relevant to vtbackup Pods, so by default a field added here will have no effect on vtbackup Pods unless we go fix the vtbackup Pod code to look at the new field.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
Copy link
Contributor

@avaidyanatha avaidyanatha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I'm also unsure what @enisoc meant by the field being respected for vtbackup pods, but other than that it's solid.

@PrismaPhonic PrismaPhonic merged commit bc0e959 into master Aug 18, 2020
@PrismaPhonic PrismaPhonic deleted the backup-annotations branch August 18, 2020 00:55
@@ -306,7 +306,7 @@ func vttabletSpecs(vts *planetscalev2.VitessShard, parentLabels map[string]strin
drain.SupportedAnnotation: "ensure that the tablet is not a master",
}
update.Annotations(&annotations, pool.Annotations)

update.Annotations(&annotations, backupLocation.Annotations)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to watch out for the case when backupLocation is nil. Unlike vtbackup, we still reconcile vttablets when backups are not configured.

@enisoc enisoc changed the title Backup Annotiations Backup Annotations Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants